#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isFascinating(int n) {
        vector<int> v1;
        int x = 3;
        while (x)
        {
            v1.push_back((n * x) / 100);
            v1.push_back((n * x) / 10 % 10);
            v1.push_back((n * x) % 10);
            x--;
        }
        sort(v1.begin(), v1.end());
        int it = unique(v1.begin(), v1.end()) - v1.begin();
        cout << it << endl;
        for (auto e : v1)
        {
            cout << e << " ";
        }
        return v1[it - 1] < 10 && v1[0] > 0 && it == 9;
    }
};